package com.guaju.yueshangLife.widget;

import android.content.Context;
import android.databinding.DataBindingUtil;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;

import com.guaju.yueshangLife.R;
import com.guaju.yueshangLife.databinding.SearchHistoryItemBinding;

/**
 * Created by guaju on 2018/9/12.
 */

public class SearchHistoryItem extends FrameLayout{

    private LayoutInflater layoutInflater;
    private SearchHistoryItemBinding binding;


    public SearchHistoryItem(Context context) {
        super(context);
        init();
    }

    public SearchHistoryItem(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        init();
    }

    private void init() {
        layoutInflater = LayoutInflater.from(getContext());
        binding = DataBindingUtil.inflate(layoutInflater, R.layout.search_history_item, this, true);
    }

    public void settext(String title){
        if (TextUtils.isEmpty(title)){
            return;
        }
        binding.title.setText(title);
    }
}
